package demo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

//@ComponentScan(basePackages = "demo")
public class demoT1 {
    public static void main(String[] args) throws Exception{
//        Class aClass = Class.forName("demo.Person");
//        Person p = (Person) aClass.newInstance();
//        p.sayHello();

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("demo");
        Person bean = context.getBean(Person.class);
//        User bean1 = context.getBean(User.class);
        bean.sayHello();
        System.out.println(bean.age);
        System.out.println(bean.name);
        bean.toString();
        System.out.println(bean);
//        bean1.sayHello();
//          bean1.sayHi();


    }
}
